package com.ac.scum.log.web.model.pack.controller;

import com.ac.common.core.exception.BaseException;
import com.ac.common.core.result.Result;
import com.ac.scum.log.bean.Package;
import com.ac.scum.log.web.model.pack.service.ServerPackageService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : acfan
 * date : create in 2024/5/28 18:04
 * description : 服务器套餐
 **/
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("pack/server")
public class ServerPackageController {
    private final ServerPackageService serverPackageService;

    @GetMapping("by/{id}")
    public Result<List<Package>> page(@PathVariable("id") Long id) throws BaseException {
        return Result.ok(serverPackageService.findByServerId(id));
    }
}

